﻿using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace MvcSample.Infrastructure.Filters
{
    public class CustomResourceFilter
        : Attribute,
        IResourceFilter
    {
        private readonly ILogger<CustomResourceFilter> _logger;
        public CustomResourceFilter(ILogger<CustomResourceFilter> logger)
        {
            _logger = logger;
        }
        public void OnResourceExecuted(ResourceExecutedContext context)
        {
            _logger.LogInformation("Resource executed!");
        }

        public void OnResourceExecuting(ResourceExecutingContext context)
        {
            _logger.LogInformation("Resource executing!");
        }
    }
}
